#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

/**
 * @brief MainWindow::on_pushButton_clicked
 * 计算总价
 */
void MainWindow::on_pushButton_clicked()
{
    int count = ui->count->value();
    int price = ui->price->value();
    int total = ui->total->value();

    total = count * price;
    ui->total->setValue(total);
}

void MainWindow::on_pushButton_2_clicked()
{
    double count = ui->count2->value();
    double price = ui->price2->value();
    double total = ui->total2->value();

    total = count * price;
    ui->total2->setValue(total);
}
